package com.zlb.app.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Desc 上传枚举类
 * @Author zWX1367238
 * @Date 2024-08-16 10:42:09
 **/
@Getter
@AllArgsConstructor
public enum UploadModeEnum {
    OSS("oss", "ossUploadStrategyImpl"),
    MINIO("minio", "minioUploadStrategyImpl"),
    SYSTEM("system", "systemUploadStrategyImpl"),
    PROJECT("project", "projectUploadStrategyImpl");

    private final String mode;

    private final String strategy;

    public static String getStrategy(String mode) {
        for (UploadModeEnum value : UploadModeEnum.values()) {
            if (value.getMode().equals(mode)) {
                return value.getStrategy();
            }
        }
        return null;
    }
}
